import request from "@/utils/request";
//获取一级分类
// GET /admin/product/getCategory1
//获取二级分类
// GET /admin/product/getCategory2/{category1Id}
//获取三级分类
// GET /admin/product/getCategory3/{category2Id}

export interface CategoryModel {
  id:number,
  name:string,
  category1Id?:number,
  category2Id?:number,
}
export type CategoryListModel = CategoryModel[];
export default {
  getCategory1 :()=>{
    return request.get<any,CategoryListModel>("/admin/product/getCategory1");
  },
  getCategory2 :(category1Id:number)=>{
    return request.get<any,CategoryListModel>(`/admin/product/getCategory2/${category1Id}`);
  },
  getCategory3 :(category2Id:number)=>{
    return request.get<any,CategoryListModel>(`/admin/product/getCategory3/${category2Id}`);
  }
}